import requests


def get_book():
    # 获取书本的信息
    url = 'http://search.dangdang.com/'
    result = requests.get(url, params={
        'key': '9787115428028',
        'act': 'input'
    })
    # print(result.text)

    # json的方式获取数据
    # result.json
    print(result.status_code)
    print(result.encoding)
    # result.encoding = 'utf-8'


if __name__ == '__main__':
    get_book()
